﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DTO;
namespace QLDT
{
    public partial class frm_GuiDeTai : Form
    {
        DTO_TaiKhoan taikhoan;
        public frm_GuiDeTai()
        {
            InitializeComponent();
        }
        public frm_GuiDeTai(DTO_TaiKhoan tk)
        {
            taikhoan = new DTO_TaiKhoan();
            taikhoan = tk;
            InitializeComponent();
        }
        private void textEdit10_EditValueChanged(object sender, EventArgs e)
        {

        }

        private void frm_GuiDeTai_Load(object sender, EventArgs e)
        {

            load();
        }
        public void load()
        {
            gridQLDetai.DataSource = BUS.BUS_DeTai.selectDeTai_TheoGiangVien(taikhoan.TenTK);
        }

        private void frm_GuiDeTai_Load_1(object sender, EventArgs e)
        {
            load();
        }

        private void txt_MaDT_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_TenDT.Focus();
        }

        private void txt_TenDT_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_SVToiDa.Focus();
        }

        private void txt_SVToiDa_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_SoSVHH.Focus();
        }

        private void txt_SoSVHH_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                grid_MaLoaiDT.Focus();
        }

        private void grid_MaLoaiDT_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                grid_MaCN.Focus();
        }

        private void grid_MaCN_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                drid_MaGV.Focus();
        }

        private void drid_MaGV_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_NgayCapNhat.Focus();
        }

        private void txt_NgayCapNhat_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_SoTuan.Focus();
        }

        private void txt_SoTuan_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_HocKy.Focus();
        }

        private void txt_HocKy_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_NamHoc.Focus();
        }

        private void txt_NamHoc_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_HanDoiDT.Focus();
        }

        private void txt_TrangThai_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                txt_TrangThai.Focus();
        }

        private void txt_SVToiDa_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar)
          && !char.IsDigit(e.KeyChar)
          && e.KeyChar != '.')
            {
                e.Handled = true;
            }


            if (e.KeyChar == '.'
                && (sender as TextBox).Text.IndexOf('.') > -1)
            {
                e.Handled = true;
            }
        }

        private void txt_SoSVHH_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar)
          && !char.IsDigit(e.KeyChar)
          && e.KeyChar != '.')
            {
                e.Handled = true;
            }


            if (e.KeyChar == '.'
                && (sender as TextBox).Text.IndexOf('.') > -1)
            {
                e.Handled = true;
            }
        }

        private void txt_SoTuan_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar)
          && !char.IsDigit(e.KeyChar)
          && e.KeyChar != '.')
            {
                e.Handled = true;
            }


            if (e.KeyChar == '.'
                && (sender as TextBox).Text.IndexOf('.') > -1)
            {
                e.Handled = true;
            }
        }

        private void txt_HocKy_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar)
          && !char.IsDigit(e.KeyChar)
          && e.KeyChar != '.')
            {
                e.Handled = true;
            }


            if (e.KeyChar == '.'
                && (sender as TextBox).Text.IndexOf('.') > -1)
            {
                e.Handled = true;
            }
        }

        private void txt_NamHoc_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsControl(e.KeyChar)
          && !char.IsDigit(e.KeyChar)
          && e.KeyChar != '.')
            {
                e.Handled = true;
            }


            if (e.KeyChar == '.'
                && (sender as TextBox).Text.IndexOf('.') > -1)
            {
                e.Handled = true;
            }
        }
    }
}
